<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>@yield('title', '购物车')</title>
    <meta name="keywords" content="@yield('keywords', setting('keywords'))">
    <meta name="description" content="@yield('description', setting('description'))">
    <meta name="render" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link href="{{asset('images/common/favicon.png')}}" rel="icon">
    <link href="{{asset('css/cart.css')}}" rel="stylesheet" type="text/css">
    <script src="{{asset('js/base.js')}}" type="text/javascript"></script>
</head>
<body>
@include('common.top', [])
<div class="header">
    <div class="area banner">
        <div class="global-logo">
            <img src="{{asset('images/cugeng/global-logo.png')}}">
        </div>
        <div class="global-search-box">
            <form method="get" action="{{url('/search')}}">
                <div class="input-box">
                    <input type="text" class="text" placeholder="商品名称" name="q" value="{{$q or ''}}">
                    <input type="submit" class="btn" value="搜索">
                </div>
            </form>
        </div>
    </div>
</div>
<div class="area cart">
    <div class="cart-filter-bar">
        <span>总计{{$totalCount}}件商品</span>
        <strong>全部商品</strong>
    </div>
    <div class="cart-main">
        <form method="post" id="FrmCart" autocomplete="off" action="{{url('/buy/order/confirm_order')}}">
            {{csrf_field()}}
            <div class="cart-table-th">
                <table cellspacing="0" cellpadding="0" width="100%">
                    <tbody>
                    <tr>
                        <th width="100">
                            <label>
                                <input type="checkbox" class="checkmark" data-action="checkall">
                                <span>全选</span>
                            </label>
                        </th>
                        <th>商品信息</th>
                        <th width="100">单价</th>
                        <th width="120">数量</th>
                        <th width="100">金额</th>
                        <th width="100">操作</th>
                    </tr>
                    </tbody>
                </table>
            </div>
            @if ($shoplist)
                @foreach ($shoplist as $shop_id=>$shop)
                    <div class="cart-item">
                        <h3>
                            <input title="" type="checkbox" class="checkmark groupCheckbox" data-target=".group_{{$shop_id}}">
                            <span class="iconfont icon-shopfill"></span><a href="{{shop_url($shop_id)}}" target="_blank">{{$shop['shop_name']}}</a>
                        </h3>
                        <div class="order-content">
                            <table cellpadding="0" cellspacing="0" width="100%">
                                @foreach($shop['items'] as $itemid=>$item)
                                <tbody id="item-{{$itemid}}">
                                <tr @if($loop->first) class="first"@endif>
                                <td class="item-info">
                                    <input type="hidden" id="price_{{$itemid}}" value="{{$item['price']}}">
                                    <div class="chk">
                                        <input title="" type="checkbox" class="checkmark CheckBoxItem group_{{$shop_id}}" name="items[]" value="{{$itemid}}">
                                    </div>
                                    <div class="g-pic bg-cover" style="background-image: url({{image_url($item['thumb'])}})">
                                        <a href="{{item_url($itemid)}}" target="_blank"></a>
                                    </div>
                                    <div class="g-info">
                                        <div class="g-name"><a href="{{item_url($itemid)}}" target="_blank">{{$item['title']}}</a></div>
                                    </div>
                                </td>
                                <td width="100"></td>
                                <td width="100">
                                    <p style="color: #999; margin-bottom: 3px;"><s>{{$item['price'] or ''}}</s></p>
                                    <strong>￥{{$item['price']}}</strong>
                                </td>
                                <td width="120">
                                    <div class="quantity-inner">
                                        <div class="act-btn decrease" data-id="{{$itemid}}">-</div>
                                        <div class="textfield">
                                            <input title="" type="text" class="text" value="{{$item['quantity']}}" id="quantity_{{$itemid}}">
                                        </div>
                                        <div class="act-btn increase" data-id="{{$itemid}}">+</div>
                                    </div>
                                </td>
                                <td width="100"><strong style="color: #f40;" id="simple_total_{{$itemid}}">￥{{$item['simple_total']}}</strong></td>
                                <td width="100">
                                    <p><a>移入收藏夹</a></p>
                                    <p><a rel="delete" data-id="{{$itemid}}">删除</a></p>
                                </td>
                                </tr>
                                </tbody>
                                @endforeach
                            </table>
                        </div>
                    </div>
                @endforeach
            @else
                <div class="noaccess"><a href="{{url('/')}}">购物车空空也, 快去选购宝贝吧</a></div>
            @endif
        </form>
    </div>
    <div class="float-bar">
        <div class="wrap">
            <div class="chk">
                <input title="" type="checkbox" class="checkmark checkall" autocomplete="off" data-action="checkall">
                <span>全选</span>
            </div>
            <div class="operations">
                <a id="multiDelete">删除</a>
                <a id="moveToFavor">移入收藏夹</a>
            </div>
            <div class="right">
                <div class="item-sum">已选中<strong id="totalCount">0</strong>件商品</div>
                <div class="item-sum">合计 (不含运费): <strong id="totalFee">0.00</strong></div>
                <div class="submit-btn btn-disabled" id="settleBtn">结算</div>
            </div>
        </div>
    </div>
</div>
<script src="{{asset('js/cart.js')}}" type="text/javascript"></script>
@include('common.footer')
</body>
</html>
